import axiosUtils from '@api/env/axiosEnv'

let customAxios = axiosUtils._initAxios()

export function queryFleetOrderListByPage (param) {
  return customAxios({
    url: '/main/fleetOrder/queryFleetOrderListByPage',
    method: 'post',
    data: param
  })
}

export function findDetailListByFleetOrderNo (param) {
  return customAxios({
    url: '/main/fleetOrderDetail/findDetailListByFleetOrderNo',
    method: 'post',
    data: param
  })
}

// 獲取掏箱歷史記錄
export function getTakeOutContainerByDriverByPage (param) {
  return customAxios({
    url: '/main/dirverTakeOutContainer/getTakeOutContainerByDriverByPage',
    method: 'post',
    data: param
  })
}

// 批量撤销掏箱
export function destoryTakeOutConByFleetId (param) {
  return customAxios({
    url: '/main/fleetOrderDetail/destoryTakeOutConByFleetId',
    method: 'post',
    data: param
  })
}

// 批量完成掏箱
export function completTakeOutConByFleetId (param) {
  return customAxios({
    url: '/main/fleetOrderDetail/completTakeOutConByFleetId',
    method: 'post',
    data: param
  })
}

export function getFleetOrderDetailListByPage (param) {
  return customAxios({
    url: '/main/fleetOrderDetail/getFleetOrderDetailListByPage',
    method: 'post',
    data: param
  })
}

// 车队派司机
export function assignmentToDriver (param) {
  return customAxios({
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    url: '/main/fleetOrderDetail/assignmentToDriver2',
    method: 'post',
    data: param
  })
}

export function assignmentToDriverNoAppoint (param) {
  return customAxios({
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    url: '/main/fleetOrderDetail/assignmentToDriverNoAppoint2',
    method: 'post',
    data: param
  })
}

export function assignmentToDriverRemove (param) {
  return customAxios({
    headers: {
      'Content-Type': 'application/json;charset=UTF-8'
    },
    url: '/main/fleetOrderDetail/assignmentToDriverRemove2',
    method: 'post',
    data: param
  })
}

// 派单预报
export function getdistributionForeCast (param) {
  console.log(param)
  return customAxios({
    url: '/ConsumeAssignOrdersController/getConsumeAssignOrdersListByPage',
    method: 'post',
    data: param
  })
}

export function confirmdistributionForeCast (param) {
  return customAxios({
    url: '/ConsumeAssignOrdersController/ConfirmConsumeAssignOrders',
    method: 'post',
    data: {
      orderNo: param
    }
  })
}

export function getdistributionForeCastFleetName (param) {
  return customAxios({
    url: '/ConsumeAssignOrdersController/getFleetName',
    method: 'post'
  })
}

export function fleetBindDriverOrder (param) {
  return customAxios({
    url: '/main/driverOrderDetail/fleetBindDriverOrder',
    method: 'post',
    data: param
  })
}

export function getContainerNoFromDrivers (param) {
  return customAxios({
    url: '/main/driverOrderDetail/getContainerNoFromDrivers',
    method: 'post',
    data: param
  })
}
